package proxy.staticed.impl;

import proxy.staticed.Wrapper;

/**
 * @Proxy: 代理类
 * @author: ZBoHang
 * @time: 2021/9/30 16:15
 */
public class Proxy implements Wrapper {

    private final Real real;

    public Proxy(Real real) {
        this.real = real;
    }

    @Override
    public void byTheAgentMethod() {
        this.before();
        this.real.byTheAgentMethod();
        this.after();
    }

    private void before() {
        System.out.println("执行之前");
    }

    private void after() {
        System.out.println("执行之后");
    }
}
